
package xib;

import java.io.IOException;
import java.util.ArrayList;

/**
 *
 * @author xavierds
 */
public interface Handler {

    /**
     * Load the file defined in the pathname with the default adapter.
     * @param pathname
     */
    public void loadFile(String pathname) throws IOException;

    /**
     * Obtain the number of each Chapter present in the file.
     * @return an ArrayList with all the chapters numbers of the file.
     */
    public ArrayList<Integer> getChaptersNumbers();

    /**
     * Obtain the number of pages presents in the file.
     * @return Integer
     */
    public int getTotalPages();

    /**
     * Obtain the number of panels presents in the file.
     * @return Integer
     */
    public int getTotalPanels();

    /**
     * Obtain the number of pages of one concrete Chapter.
     * @return Integer
     */
    public int getNumPagesOfChapter(int chapterNumber);


    /**
     * Obtain the next page loaded in the handler.
     * @return Page.
     */
    public Page getNextPage();

    /**
     * Obtain the previous page loaded in the handler.
     * @return Page.
     */
    public Page getPreviousPage();

    /**
     * Obtain the page from a chapterNumber in the page position.
     * @param chapterNumber with the number of the chapter
     * @param page
     * @return Page
     */
    public Page getPageAt(int chapterNumber, int page);

    /**
     * Obtain the page from a page position.
     * @param page
     * @return Page
     */
    public Page getPageAt(int page);


    /**
     * Obtain the next panel.
     * @return Panel
     */
    public Panel getNextPanel();

    /**
     * Obtain the previous panel.
     * @return Panel
     */
    public Panel getPreviousPanel();

    /**
     * Obtain the panel from a specific chapter number, in a specific page
     * from the panel order.
     * @param chapterNumber
     * @param page
     * @param panelOrder
     * @return Panel
     */
    public Panel getPanelAt(int chapterNumber, int page, int panelOrder);

    /**
     * Obtain the panel from a specific page
     * from the panel order.
     * @param page
     * @param panelOrder
     * @return Panel
     */
    public Panel getPanelAt(int page, int panelOrder);

    /**
     * Obtain a list of avalaibles languages of the file.
     * @return
     */
    public ArrayList<String> getAvailaiblesLanguages();

    /**
     * Set the default language to view the panels.
     * @param language
     * @return
     */
    public boolean setLanguage(String language);



}
